#!/usr/bin/python
# -*- coding: utf-8 -*-

'''
Introduction to Programming in Java - An Interdisciplinary Approach

All book programs ported to Python by
Scott C. King (revisionx at {gee}ma1l <dot> c0m).

All program examples pass Pylint with a perfect 10.00 score.
Pylint:  http://www.pylint.org/


# Program 1.3.1 - Flipping a fair coin

Syntax:
python flip.py


Notes:
random is a required import as a substitute for Java's Math.random()
https://docs.python.org/2/library/random.html

'''

import random


def main():
    ''' Print the result of a simulated coin flip. '''

    if random.random() < .5:
        print "Heads"
    else:
        print "Tails"


if __name__ == '__main__':
    main()




